# Maintainer:

pkgbase=pysmbc
pkgname=('python2-pysmbc' 'python-pysmbc')
pkgver=1.0.15.8
pkgrel=2
arch=('x86_64')
url="http://pypi.python.org/pypi/pysmbc/"
license=('GPL')
makedepends=('python2' 'python' 'smbclient')
# validpgpkeys=('228521116D3438163C2EA5B916BED1016069BE55')  # Tsukasa Hamano, revoked
source=(https://pypi.io/packages/source/p/${pkgbase}/${pkgbase}-${pkgver}.tar.bz2)
md5sums=('56ea1ddc2451d6c773daef37ad1807cd')

prepare() {
  cp -r ${pkgbase}-${pkgver} ${pkgbase}-${pkgver}-python2
  sed -i 's|/usr/bin/python|/usr/bin/python2|' ${pkgbase}-${pkgver}-python2/smbc/xattr.py
}

build(){
  cd ${pkgbase}-${pkgver}
  python setup.py build
  cd "${srcdir}"/${pkgbase}-${pkgver}-python2
  python2 setup.py build
}

package_python-pysmbc() {
  pkgdesc="Python 3 bindings for libsmbclient"
  depends=('python' 'smbclient')

  cd ${pkgbase}-${pkgver}
  python setup.py install --root="$pkgdir" --optimize=1
}

package_python2-pysmbc() {
  pkgdesc="Python 2 bindings for libsmbclient"
  depends=('python2' 'smbclient')

  cd ${pkgbase}-${pkgver}-python2
  python2 setup.py install --root="$pkgdir" --optimize=1
}
